def init():
    try:
        find("ChatLobby.png")
        click("ChatLobby-1.png")
        click("ChatLobby-1.png")
    except FindFailed:
        print("Window not opened")
        
def testSendMessage():
    find("ChatLobby.png")
    click("Message.png")
    type("This is an automated test message.")
    type(Key.ENTER)
        
def testSendManyMessage():
    try:
        find("ChatLobby.png")
        click("Message.png")
        for i in range(0, 17):
            type("Test")
            type(Key.ENTER)
        
    except FindFailed:
        print("dummyderp")

def testTooLongMessage():
    find("ChatLobby.png")
    click("Message.png")
    type("Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.Lame long sentence.")
    type(Key.ENTER)

init()
testSendMessage()
testSendManyMessage()
testTooLongMessage()